<?php if(IS_PJAX):?>

    <!-- pjax 更新页面主体 -->
    <section class="content-top"></section>
    <section class="content-pop"></section>
    <section class="content-header"> </section>
    <section class="content">
        <block name="body"></block>
        <block name="extend"></block>
    </section>
    <script>KCONE.initKC2016.run();</script>
    <?php if(checkRule('Model/Cfgx')):?>
        <script> cfg_button("{$cfg->name}","{:U('model/cfgx')}",$('footer')); </script>
    <?php endif;?>

    <script>
        setBreadCrumb("<?php echo strtolower(CONTROLLER_NAME.'/'.ACTION_NAME)?>");
    </script>

<?php elseif(IS_AJAX):?>

    <!-- ajax 页面主体, 主要用于表单弹窗 -->
    <block name="body"></block>
    <block name="extend"></block>
<?php else:?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php echo strpos($html_title,':')!==false?substr($html_title,0,strrpos($html_title,':')):$html_title;?>{$html_title?'│':''}{:C('WEB_SITE_NAME')}管理平台</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    
    
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/bootstrap/css/bootstrap.min.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/icon/font-awesome-4.7.0/css/font-awesome.min.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/icon/Iionicons/ionicons.min.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/css/skins/_all-skins.min.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/iCheck/all.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datepicker/datepicker3.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/daterangepicker/daterangepicker.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/treeview/jquery.treeview.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/pace/pace.min.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datatables/dataTables.bootstrap.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datetimepicker/css/datetimepicker.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/jQueryUI/jquery-ui.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/poshytip/tip-yellowsimple/tip-yellowsimple.css");?>

    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/jQuery/jquery-2.2.3.min.js");?>
    <?php echo O('util')->assets();?>
    <?php echo O('util')->postToken();?>

    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/jQueryUI/jquery-ui.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/treeview/jquery.treeview.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/dragsort/jquery.dragsort-0.5.2.min.js");?>
    <?php echo O('util')->assets();?>
    
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/layer/layer-v3.0.1/layer.js");?>
    <?php echo O('util')->assets();?>

    <script> $.widget.bridge('uibutton', $.ui.button); //Resolve conflict in jQuery UI tooltip with Bootstrap tooltip </script>

    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/bootstrap/js/bootstrap.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/daterangepicker/moment.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/daterangepicker/daterangepicker.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datepicker/bootstrap-datepicker.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/slimScroll/jquery.slimscroll.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datatables/jquery.dataTables.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/pace/pace.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datatables/chz.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datatables/dataTables.bootstrap.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datatables/extensions/FixedHeader/js/dataTables.fixedHeader.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/js/app.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/js/datatable/column.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/js/datatable/search.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/js/datatable/searchBox.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/js/datatable/popup.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/js/datatable/callback.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/js/datatable/dataTable.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/js/datatable/dataTable.extend.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datetimepicker/js/bootstrap-datetimepicker.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/iCheck/icheck.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/pjax/jquery.pjax.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/poshytip/jquery.poshytip.min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/js/cfg.js");?>

    <!-- select2 -->
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/select2/select2.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/select2/select2.min.js");?>

    <!-- 图片上传 -->
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/kcs/kcs.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/kcs/kcs.src.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/kcs/kcs.js");?>

    <!-- 图片上传 new -->
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/uploader/jquery.uploader.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/uploader/jquery.uploader.js");?>

    <!-- 编辑器 -->
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/kindeditor/default/default.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/kindeditor/kindeditor-min.js");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/kindeditor/zh_CN.js");?>

    <!-- 右键菜单 -->
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/jquery.context-menu/jquery.contextMenu.min.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/plugins/jquery.context-menu/jquery.contextMenu.min.js");?>

    <!-- 后台样式 -->
    <?php O('util')->assets("/Kcdns/Public/Admin/css/AdminLTE.min.css");?>
    <?php O('util')->assets("/Kcdns/Public/Admin/css/AdminLTE.extend.css");?>
    <?php echo O('util')->assets();?>
</head>

<body class="sidebar-mini skin-blue">
    <script src="/Kcdns/Public/Admin/js/ie.js"></script>
    <script>$("body").addClass(KCONE.Cookie.getCookie("layout")?KCONE.Cookie.getCookie("layout"):'fixed layout-fixed').addClass(KCONE.Cookie.getCookie("skin")); </script>
    <div class="wrapper" style="padding-bottom:48px;position:static;">

        <include file="Public/header" />

        <include file="Public/header_slide" />

        <aside id="pjax-menu" class="main-sidebar">
            <include file="Public/menu" />
        </aside>

        <div id="pjax-content" class="content-wrapper">
            <section class="content-top"></section>
            <section class="content-pop"></section>
            <section class="content-header"></section>
            <script> setBreadCrumb("<?php echo strtolower(CONTROLLER_NAME.'/'.ACTION_NAME)?>"); </script>
            <section class="content">
                <block name="body"></block>
                <block name="extend"></block>
            </section>
            
        </div>

    </div>
    <footer class="main-footer">
        <div class="pull-right hidden-xs"> <b>Version</b> 1.0.2 </div> <strong>Copyright &copy; 2009-2020 <a>hyit</a>.</strong> All rights reserved.
    </footer>

    <div id="datatable-popup" class="" style="display: none;"> <div id="datatable-popup-body" class="modal-content"> <div class="popup-title"><i class="fa fa-th"></i><span></span></div> <button type="button" class="close popup-close"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> <div class="popup-block"></div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default datatable-popup-prev btn-flat" style="float:left;">&lt;</button> <button type="button" class="btn btn-default datatable-popup-next btn-flat" style="float:left;">&gt;</button> <button type="button" class="btn btn-default btn-flat btn-close">关闭</button> <button type="button" class="js-datatable-save btn btn-primary btn-flat">保存修改</button> </div> </div>
    <form id="datatable_blank_form" method="post" style="display:none;"></form><script>KFORM($('#datatable_blank_form'))</script>

    <?php if(checkRule('Model/Cfgx')):?>
        <script> cfg_button("{$cfg->name}","{:U('model/cfgx')}",$('footer')); </script>
    <?php endif;?>
    <script type="text/javascript" src="/Kcdns/Public/Admin/js/jquery.progress.js"></script>
    <script>
        $(document).on('pjax:beforeReplace', function(contents, options) {
            try{
                var json = JSON.parse(options[0].textContent);
                if(json.status===0 && json.url){
                    window.location.href=json.url;
                }
            }catch(e){}
            return false;
        });
        // 加载动画
        // $(document).ajaxStart(function() { Pace.restart();});
        var pjaxOptions = { timeout : 10000, };

        // 刷新页面
        var reload = function(){ $.pjax.reload('#pjax-content',pjaxOptions); }

        // 发送 pjax 请求时, 移除 url 中由 pjax 自动补全的参数
        $(document).on('pjax:beforeSend',function(event,xhr, jqXhr){
           jqXhr.url = jqXhr.url.replace(/&_pjax=.*$/,'');
        });

        // pjax : 点击侧边导航
        $('#pjax-menu').pjax('a.pjax','#pjax-content',pjaxOptions);
        // pjax : 更新页面主体, 用于非顶部导航链接
        $('#pjax-content').pjax('a','#pjax-content',pjaxOptions);
        KCONE.initKC2016.run();

        //后台批处理进度查询
        $(".content-header").progress();
    </script>

    {:jscron('激活计划任务进程')}
</body>

</html>
<?php endif?>
